package com.bjsxt.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface RoleMenuMapper {

    //添加
    @Insert("insert into t_role_menu values(#{param1},#{param2})")
    Integer insertRoleMenu(Integer rid,Integer mid);

    //查询指定角色下的菜单
    @Select("SELECT rm.mid from t_role_menu rm JOIN t_menu m on rm.mid=m.mid WHERE rm.rid=#{param1} and m.isparent=0")
    List<Integer> selectRoleMenu(Integer rid);

    //删除菜单
    @Delete("delete from t_role_menu where rid=#{param1}")
    Integer deleteRoleMenu(Integer rid);

}
